package com.design_patterns.singleton;

/**
 * @ClassName: LazyMan
 * @Author: ZhangYue26
 * @Description: 懒汉式单例模式
 * @Date: 2020-11-05
 */
public class LazyMan {
    public static volatile LazyMan lazyMan = null;

    public LazyMan(){}

    public static synchronized LazyMan getInstance() {
        if (lazyMan == null) lazyMan = new LazyMan();
        return lazyMan;
    }

}
